package com.example.app.components


import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.layout.Column
import androidx.compose.material.Button
import androidx.compose.material.Text
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview

@Composable
fun AnimationContent2() {
    var name by remember {
        mutableStateOf("yxy")
    }
    Column {
        Button(onClick = { 
            name += "bs"
        }) {
            Text(text = "Button")
        }
        // 基础文本动画
        Text(text = "$name", modifier = Modifier.animateContentSize())
    }
}

@Preview
@Composable
fun AnimationContent2Preview() {
    AnimationContent2()
}

